package logic

import (
	"context"
	"video-hub/models/mysql"

	"video-hub/videorpc/internal/svc"
	"video-hub/videorpc/videorpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ShowVideoLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewShowVideoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowVideoLogic {
	return &ShowVideoLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ShowVideoLogic) ShowVideo(in *videorpc.ShowVideoRequest) (*videorpc.ShowVideoResponse, error) {
	// todo: add your logic here and delete this line
	var lists []*videorpc.ShowVideo
	lists = mysql.ShowVideo(mysql.DB, in.TopicId, in.UserId)
	return &videorpc.ShowVideoResponse{
		Lists: lists,
	}, nil
}
